package com.fa.ojcodesandbox.unsafe;

import java.util.ArrayList;
import java.util.List;

/**
 * ClassName: MemoryError
 * Package: com.fa.ojcodesandbox.unsafe
 * Description: 无限占用空间（浪费系统内存）
 *
 * @Author:
 * @Create: 2024/4/27 - 19:52
 * @Version: v1.0
 */
public class MemoryError {

    public static void main(String[] args) {
        List<byte[]> list = new ArrayList<>();
        while (true) {
            list.add(new byte[1024 * 1024 * 1024]);
        }
    }
}
